package com.wxy.demo.security;

import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

/**
 * <p>
 * UrlEncode编码解码
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2023/1/5 11:04
 */
public class UrlEncodeDemo {
    public static void main(String[] args) {
        String encode = URLEncoder.encode("你好", StandardCharsets.UTF_8);
        System.out.println(encode);
        String decode = URLDecoder.decode(encode, StandardCharsets.UTF_8);
        System.out.println(decode);
    }
}
